﻿
<!DOCTYPE html>
<html>
<head>
    <!--<base href="../" />-->
    <meta charset="UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/static/css/common/reset.css" />
    <link rel="stylesheet" href="/static/css/associate.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor-html.css" />
    <link rel="stylesheet" href="/static/css/jquery-validate.css" />
    <title>宾果高校</title>
</head>
<body>
    <div class="associate">
        <div id="divHeader"></div>
        <section class="assoc-content container clearfix">
            <div class="assoc-c-left fl">

                <div id="divNavigation"></div>
            </div>

            <div class="assoc-c-right fr">
                <div class="assoc-cr-bind ">
                    <h2 class="colorRed f14">修改信息前，请先输入已绑定手机号，获取验证码</h2>
                    <div class="form_control">
                        <input type="text" data-tip="请输入手机号码" data-valid="isNonEmpty||isMobile" data-error="手机号码不能为空||手机号码不正确" class="reg-tlogin-tel mt20 required" placeholder="请输入手机号码" id="phoneNo" />
                    </div>
                    <div class="assoc-crb-input mt20 clearfix">
                        <div class="form_control veriCode">
                            <input type="text" class="required" data-tip="请输入验证码" data-valid="isNonEmpty" data-error="验证码不能为空" placeholder="请输入验证码" id="code" />
                        </div>
                        <a href="javascript:void(0)" id="getAuditcode" class="ml10">获取验证码</a>
                    </div>
                    <p class="assoc-crb-text mt20">※为了打造一个证实公平的平台，修改信息后将重    新进入后台审核阶段，届时请耐心审核认证</p>
                    <input type="button" class="assoc-crb-btn" value="进入修改" id="assoc-crb-btn" />
                </div>
            </div>

        </section>
    </div>
    <div id="divFooter"></div>

    <script type="text/javascript" src="/static/js/ref/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/static/js/self/common.js"></script>
    <script type="text/javascript" src="/static/js/ref/sweetalert.min.js"></script>
    <script src="/static/js/self/jquery-validate.js"></script>
    <script>
        common.validator($('form'));

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
        $("#divHeader").load("/wuc/header.html");
        $("#divFooter").load("/wuc/footer.html");
        $("#divNavigation").load("/wuc/navigation.html");
        function AfterCompleted(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }
        }

        function AfteAjaxPhone(ctx) {

            if (ctx == null || ctx.ResponseStr == "") {
                common.alertMessage("请输入注册时的手机号码");
                return;
            }

            common.alertMessage("验证码已经发出，请注意查收");
        }
        function AfteSubmit(ctx) {

            if (ctx == null || ctx == "") {
                common.alertMessage("请输入正确的验证码");
                return;
            }

            var type = GetQueryString("type");

            switch (type) {
                case "companyInfo":
                    window.location = "/company/company/reviseInfo.html";
                    break;
                case "communityInfo":
                    window.location = "/personal/associate/reviseInfo.html";
                    break;
                case "Agent":
                    window.location = "/agent/agent/reviseInfo.html";

            }
        }

        $("#getAuditcode").click(function () {


            var phoneNo = $('#phoneNo').val();

            if (!common.checkValue(phoneNo)) {
                alert("请输入手机号");
                return;
            }

            common.commonAjax({ type: 'Get', url: '/api/login/ValidatePhone?id=' + phoneNo + '&validType=UpdateInfo', sMethod: AfteAjaxPhone });
        })

        $("#assoc-crb-btn").click(function () {
            if ($(".assoc-cr-bind").validate('submitValidate')) {
                var phoneNo = $('#phoneNo').val();
                var code = $('#code').val();
                common.commonAjax({ type: 'Get', url: '/api/login/Get?id=' + phoneNo + '&validType=UpdateInfo&code=' + code, sMethod: AfteSubmit });
            }
        })
    </script>
</body>
</html>